package top.codecrab.cloudalibaba.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import top.codecrab.springcloud.entity.response.Result;

import java.math.BigDecimal;

/**
 * @author codecrab
 * @since 2021年05月21日 16:39
 */
@RequestMapping("/account")
@FeignClient("seata-account-service")
public interface AccountClient {

    /**
     * 扣减账户余额
     */
    @PostMapping("/decrease")
    Result decrease(@RequestParam("userId") Long userId, @RequestParam("money") BigDecimal money, @RequestParam("success") boolean success);
}
